﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using VersionComparer.Base;

namespace VersionComparer.DataModel.Assemblies
{
    [Serializable]
    [Order(10)]
    public class MethodItem : MethodBaseItem<MethodInfo>
    {

        protected override Type AssociatedType(MethodInfo value)
        {
            return value.ReturnType;
        }
        protected override string ReturnType(MethodInfo methodInfo, bool fullNamespace)
        {
            if (methodInfo.ReturnType != null)
            {
                if (fullNamespace)
                    return UnderlyingTypeRtf.Text;
                else
                    return UnderlyingTypeName;
            }
            else
                return "void";
        }

        protected override CustomAttributeData[] GetAttributes(MethodInfo value)
        {
            return CustomAttributeData.GetCustomAttributes(value).ToArray();
        }

    }
}
